home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
menus
/
popupf
/
read.me
< prev
Wrap
Text File
|
1995-03-09
|
4KB
|
96 lines
'TEST
'----
'
'1. Right-Click on the Red Label and select "Menu 5.1"
'2. Right-Click on the Blue Label and select "Menu 4.1"
'3. Right-Click on the Red Label again...weird eh?
'
'4. Now select "Make Menu 2 Invisible" under "Menu 2"
'5. Select "Pop-Up Menu 2" under "Menu 1" and select "Menu 2.1"
'6. Now Right-Click on either box... "Menu 2.1" gets fired!
'
'CHARACTERISTICS OF THE PROBLEM
'------------------------------
'
'This problem seems to happen when:
'
'- You have more than one invisible menu
'- One of these invisible menus (or one of its sub-menus) is popped-up with PopUpMenu
'- Another invisible menu (or one of its sub-menus) is popped up with PopUpMenu which is
' further down the list of menus in the VB menu design panel than the first popped-up
' menu
'
'Note: The problem occurs on two levels here; one with "Menu 4" in the
' first half of the test, and then with "Menu 2" in the second
' half
'
'Note: this problem can be damaging to your monitor; I threw mine out
' the window after hours of trying to fix it...
'
'Anyway, one CRT later, here is A SUPER SIMPLE SOLUTION!
'
'
'
'A SUPER SIMPLE SOLUTION
'-----------------------
'
'First, there are basically three types of pop-up menus you
'are probably using in terms of being dually accessible as pop-ups
'and as TOP-LEVEL menus or sub-menus:
'
'1. The kind which are never visible to the user on the TOP-LEVEL
' menu bar (either because they are sub-menus or because they
' are TOP-LEVEL, but are never visible).
'
'2. The kind which are sometimes visible to the user on the TOP-LEVEL
' menu bar when the pop-up version is shown, but not always.
'
'3. The kind which are always visible to the user on the TOP-LEVEL menu
' bar, or at least when you show it as a pop-up.
'
'Type 3 - Fine; it is not subject to this problem.
'Type 2 - Should really be converted to Type 3 in terms of good style.
'Type 1 - This is the type we encounter the problem with.
'
' First, convert any always invisible TOP-LEVEL pop-up menus into sub-menus
' under another one of your TOP-LEVEL menus. This is necessary since we
' will play with the .Visible property in this solution (note that this
' is one of the differences between FRUSTRAT.FRM in FRUSTRAT.MAK and
' FIXED.FRM in FIXED.MAK. This has no effect on user perception of
' TOP-LEVEL type 1 menus, since they are invisible anyway!
'
'In the form where you pop the menus up, create this sub:
'
'Sub PopUp_Menu (m as Menu, p%)
'
' mInvisPopupMenu_1.Visible = True
' mInvisPopupMenu_2.Visible = True
' ' (and so on...)
'
' PopUpMenu m, p
'
' mInvisPopupMenu_1.Visible = False
' mInvisPopupMenu_2.Visible = False
' ' (and so on...)
'
'End Sub
'
'EXPLANATION
'-----------
'
'Here, the mInvisPopupMenu_x's are the other menus of type 1. Since you
'are popping up a menu, the user can't access the menu bar anyway...
'so it doesn't matter if these all become visible sub-menus while the pop-up menu
'is visible! This even works if your pop-up activates a modal form...
'before the current form becomes active again, the rest of this sub
'will execute, re-hiding the menus which are not visible!
'
'Just call this routine with the same parameters in place of PopUpMenu!
'(you will have to add a zero to the call if you don't use p consistently
' - alternatively, if you never use it, exclude it from the Sub, or even
'put your always used value in the PopUpMenu call in the sub and drop
'it from the declaration!). In any case, the problem will disappear!
'
'If you have any other suggestions or additional solutions, please contact
'myself, Dathan Liblik (74663,1364 on Compuserve). Good luck!